<?php
//栈 ：先进后出
$static = new SplStack();
$static->push("data1");
$static->push("data2");
//输出结果先为data1后为data2
echo $static->pop();
echo $static->pop();
echo "<hr>";

//队列
$queue = new SplQueue();
$queue -> enqueue('data1');
$queue -> enqueue('data2');

echo $queue -> dequeue();
echo $queue -> dequeue();
echo "<hr>";

//最小堆
$heap = new SplMinHeap();
$heap -> insert('data1');
$heap -> insert('data2');

echo $heap -> extract();
echo $heap -> extract();
echo "<hr>";

//固定长度的数组

$array = new SplFixedArray(10);
$array[1] = 123;
$array[3] = 456;
echo "<pre>";
print_r($array);
